package com.iflytek.day26;

import java.io.FileInputStream;
import java.io.IOException;

public class _05_FileInputStreamDemo {
  public static void main(String[] args) throws IOException {
    // 创建字节输入流对象
    // FileInputStream(String name)
    FileInputStream fis = new FileInputStream("src\\com\\iflytek\\day26\\fos.txt");
    int by;
    /*
        fis.read()：读数据
        by=fis.read()：把读取到的数据赋值给by
        by != -1：判断读取到的数据是否是-1
     */
    while ((by = fis.read()) != -1) {
      System.out.print((char) by);
    }
    // 释放资源
    fis.close();
  }
}
